﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ccit.ClassLibrary;

namespace Ccit.SysPlat.Organ
{
    /// <summary>
    /// Description: 系统平台组织机构 -> 系统用户接口
    /// Author: tim 2010-02-10
    /// </summary>
    public interface IUser
    {
        /// <summary>
        /// 获取用户集合
        /// </summary>
        /// <param name="whereClause">过滤条件</param>
        /// <returns></returns>
        DataSet GetUserList(MsUser whereClause);

        /// <summary>
        /// 获取用户消息对象
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="enContainExtend">是否包含扩展信息</param>
        /// <returns></returns>
        MsUser GetUserInfo(string userId,eTrueFalse enContainExtend);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userIds">用户Id串</param>
        /// <returns>
        ///     【0】: 操作结果
        ///     【1】: 提示消息
        /// </returns>
        List<string> Delete(string userIds);

        /// <summary>
        /// 恢复用户记录
        /// </summary>
        /// <param name="userIds">用户Id串</param>
        /// <returns>
        ///     【0】: 操作结果
        ///     【1】: 提示消息
        /// </returns>
        List<string> Resume(string userIds);

        /// <summary>
        /// 恢复用户默认口令
        /// </summary>
        /// <param name="userIds">用户Id串</param>
        /// <returns>
        ///     【0】: 操作结果
        ///     【1】: 提示消息
        /// </returns>
        List<string> ResumeDefPwd(string userIds);

        /// <summary>
        /// 向上调整用户显示顺序
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="curOrder">调整前显示顺序</param>
        /// <returns>
        ///     【0】: 操作结果
        ///     【1】: 提示消息
        /// </returns>
        List<string> MoveUp(string userId, string curOrder);


        /// <summary>
        /// 向下调整用户显示顺序
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="curOrder">调整前显示顺序</param>
        /// <returns>
        ///     【0】: 操作结果
        ///     【1】: 提示消息
        /// </returns>
        List<string> MoveDown(string userId, string curOrder);
                
        /// <summary>
        /// 根据用户Id串返回用户名称串
        /// </summary>
        /// <param name="userIds">逗号分隔的用户Id串</param>
        /// <param name="separator">返回的用户姓名间的分隔符</param>
        /// <returns></returns>
        string GetUserNamesByIds(string userIds,string separator);


        /// <summary>
        /// 根据用户Id串返回用户名称串
        /// </summary>
        /// <param name="userIds">逗号分隔的用户Id串</param>
        /// <param name="separator">返回的用户姓名间的分隔符</param>
        /// <param name="isFilter">是否过滤掉无效的串</param>
        /// <returns></returns>
        string GetUserNamesByIds(string userIds, string separator, eTrueFalse isFilter);


        /// <summary>
        /// 根据用户Id串返回用户记录名-值对儿字典集合
        /// </summary>
        /// <param name="userIds">用户Id串</param>
        /// <param name="findUserName">模糊查找用户名</param>
        /// <returns></returns>
        List<MsKeyValue> GetUserListByIds(string userIds,string findUserName);

        /// <summary>
        /// 获取机构下的用户记录名-值对儿字典集合
        /// </summary>
        /// <param name="organId">机构Id</param>
        /// <param name="filterUserIds">过滤掉的用户记录Id串</param>
        /// <param name="enEffect">获取有效/无效用户记录标志</param>
        /// <returns></returns>
        List<MsKeyValue> GetUserListByOrgan(string organId, string filterUserIds,eTrueFalse enEffect);


        /// <summary>
        /// 保存用户记录
        /// </summary>
        /// <param name="msUser">用户信息消息对象</param>
        /// <returns>
        ///     【0】: 操作结果
        ///     【1】: 提示消息 
        /// </returns>
        List<string> Save(MsUser msUser);


        /// <summary>
        /// 获取机构下的用户记录名-值对儿字典集合(根据Where条件)
        /// </summary>
        /// <param name="organId">机构Id</param>      
        /// <param name="enEffect">获取有效/无效用户记录标志</param>
        /// <param name="whereClause">过滤条件</param>
        /// <returns></returns>
        List<MsKeyValue> GetUserListByOrgan(string organId, eTrueFalse enEffect, string whereClause);


        /// <summary>
        /// 获取在线人员版块数据
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <returns></returns>
        string GetOnlineData(string userId);


        /// <summary>
        /// 设置人员登录状态
        /// </summary>
        /// <param name="loginUser"></param>
        /// <param name="status">0:离线 / 1:在线</param>
        /// <returns></returns>
        List<string> SetUserOnlineStatus(MsLoginUser loginUser, string status);


        /// <summary>
        /// 校验用户口令
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="enUserType">用户类型</param>
        /// <param name="oriPwd">用户原始口令</param>
        /// <returns></returns>
        List<string> CheckUserPwd(string userId, eUserType enUserType, string oriPwd);

        /// <summary>
        /// 修改用户口令
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="enUserType">用户类型</param>
        /// <param name="newPwd">新口令</param>
        /// <returns></returns>
        List<string> ModifyPwd(string userId, eUserType enUserType, string newPwd);
    }
}
